using System;
using System.Collections;
using System.Collections.Generic;

namespace CVS
{
    public interface IRemoteServer
    {
        int KFactor { get; set; }
        string ServerType { get; set; }
        string Address { get; set; }

        IGestorRepositorios GetManager();
        int GetServId();
        int GetRepId();
        ArrayList GetClientList();
        ArrayList GetReplicateList();

        void InitializeServer(string mode, int serv_id, int kfactor, string server_address, string own_address);

        void AddServerToHashTable(string newServer);   
        void AddClient(string addressClient, int index);
        void AddServer(string serverAddress, int index);
        void RemoveServer(string addressToRemove);

        IRepositorio Checkout(int repository_id, int contador);

        int Checkin(IRepositorio repository,int contador);
        void CheckinProp(IRepositorio repository);

        IRepositorio CreateRep(string name);
        IRepositorio CreateRepProp(string name, int rep_id, string main_address);

        Boolean DeleteRep(string rep_id,int contador);
        Boolean DeleteRepProp(string rep_id);

        string ListFiles(string rep_id,int contador);

        IFicheiro CreateFile(string rep, string name);
        IFicheiro CreateFileProp(string rep, string name);

        int DeleteFile(string rep, string name,int contador);
        void DeleteFileProp(string rep, string name);

        void UpdateReplicaList(string rep_id, List<string> list);
        void UpdateServerList(ArrayList lstRep);
        void UpdateClientList(ArrayList lstCli);
        void UpdateNetwork(string address);
        void Balance(); 
       
        bool Ping();
        bool AssignNewReplica(IRepositorio rep, string address);
        void ChooseNewPrimaryRepository(string address);
        void UpdateRepositoryStatus(string id, string address);

        void Print();
        void Hold(string serverId);
        void Resume(string serverId);
        void Load(string fileName);

    }
}
